﻿using System;
using System.Collections.Generic;
using System.Text;
using Huayou.Utils;

namespace HySoft.Cash
{
	public static class SafeDateTime
	{
        private static int zoneDiff = 25;
        /// <summary>
        /// 本地时间跟服务器的时差
        /// </summary>
        public static int ZoneDiff
        {
            get
            {
                if (zoneDiff == 25)
                {
                    zoneDiff = AppSettings.ZoneDiff;
                }

                return zoneDiff;
            }
        }


        public static DateTime LocalNow
        {
            get
            {
                return DateTime.Now.AddHours(ZoneDiff);
            }
        }


        public static DateTime LocalToday
        {
            get
            {
                return LocalNow.Date;
            }
        }
	}
}
